﻿using System.Data.Entity;
using System.Data.Common;
using System.Configuration;
using Lin.EFData.Table;

namespace Lin.EFData
{
    public class SysContext:DbContext,ISysContext
    {
        private static readonly string conn = ConfigurationManager.ConnectionStrings["connString"].ToString();

        public SysContext()
            : base(conn)
        {
            base.Configuration.LazyLoadingEnabled = true;
        }

        public SysContext(string nameOrconn)
            : base(nameOrconn)
        {
            base.Configuration.LazyLoadingEnabled = true;
        }

        public SysContext(DbConnection conn)
            : base(conn, true)
        {
            base.Configuration.LazyLoadingEnabled = true;
        }

        #region 数据库隐射实体
        public DbSet<LinUser> LinUser { set; get; }
        public DbSet<LinRole> LinRole { set; get; }
        #endregion
    }
}
